package com.yxy.controller.mobile;

import com.yxy.common.Result;
import com.yxy.constant.RequestMapperConstant;
import com.yxy.domain.vo.BannerVO;
import com.yxy.service.BannerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userBannerController")
@RequestMapping(RequestMapperConstant.USER_REQUEST_MAPPER + "banner")
@Slf4j
public class BannerController {

    private BannerService bannerService;
    public BannerController(BannerService bannerService){
        this.bannerService = bannerService;
    }

    /**
     * 获取轮播图列表
     * @return
     */
    @GetMapping
    public Result<List<BannerVO>> list(){
        log.info("获取轮播图列表");
        List<BannerVO> vo = bannerService.list();
        return Result.success("", vo);
    }
}
